package se.plingapp.backingbeans;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import se.plingapp.enterprisebeans.UserFacade;
import se.plingapp.entitybeans.User;

/**
 *
 * @author Jens Ljungblad
 */
@ManagedBean
@RequestScoped
public class RegistrationBean {

    @EJB
    private UserFacade userFacade;

    private User user = new User();

    public User getUser() {
        return this.user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String register() {
        user = userFacade.create(user);
        return "/start.xhtml?faces-redirect=true";
    }
}
